﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>出勤信息详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../static/css/font.css">
    <link rel="stylesheet" href="../../../static/css/weadmin.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .showleft {
            text-align: left;
            min-width: 150px;
        }
    </style>
</head>
<body>
    <div class="weadmin-body">
        <table id="datalist" lay-filter="datalist"></table>
    </div>
    <script src="../../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../../static/js/common.js" charset="utf-8"></script>

    <script>
        layui.use(['table', 'jquery'], function () {
         var table = layui.table,
             $ = layui.jquery;
            $.support.cors = true;


            table.render({
                id: "datalist",
                elem: '#datalist',
                url: ApiUrl + 'AttendanceInfo/GetProjectQuestionDetail', //数据接口,
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
                where: { AttendanceDateTime: getUrlParam("AttendanceDateTime"), UserID: getUrlParam("UserID") },
                cellMinWidth: 80,
                toolbar: "#toolbar",
                cols: [
                    [
                        { field: 'UserID', title: '用户编号', width: 200 },
                        { field: 'UserName', title: '用户名称', width: 200 },
                        { field: 'AttendanceDateTime', title: '出勤时间', width: 200 }
                    ]
                ],
                parseData: function (res) { //res 即为原始返回的数据
                    return {
                        "code": res.StatusCode, //解析接口状态
                        "msg": res.Info, //解析提示文本
                        "count": res.Count, //解析数据长度
                        "data": res.Data //解析数据列表
                    };
                },
                response: { statusCode: 200 },//规定成功的状态码，默认：0
                event: true,
                page: true,
                done: function (res, curr, count) {
                    //如果是异步请求数据方式，res即为你接口返回的信息。
                    //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度 
                    if (res.code == 403) {
                        layer.alert(res.msg, function () {
                            top.location.href = "http://" + top.location.host + "/login.html";
                        })
                    }
                }
            });
            
        });
    </script>
</body>
</html>